#include "TLabel.h"
#include <time.h>


//-------------------------------------

TLabel::TLabel( LabelType t, QVector< double > * data ) :
    vals( 0 )
{
    vals = data;
    lType = t;
}

//-------------------------------------

Qwt3D::Scale * TLabel::clone() const
{
    return new TLabel( *this );
}

//-------------------------------------

QString TLabel::ticLabel( unsigned int idx ) const
{
    /*
    if( idx < majors_p.size() && idx < 26 )
        return QString( QChar( 'A'+idx ) );
    return QString( "-" );
    */
    if( vals && vals->count()-1 >= idx )
    {
        switch( lType )
        {
            case ltNODE:
                return QString::number( vals->at( idx ) );
            case ltTIME:
            {
                time_t t = vals->at( idx );
                return QString( ctime( &t ) );
            }
        }


    }
    return QString::number( idx );
}

//-------------------------------------




